<div class='col-md-6 col-md-offset-3'>
  <form ng-submit='register()' name='registerForm'>
    <div class='form-group'
      ng-show="config.login_method == 'local'">
      <label for='email'>Email</label>
      <div class='input-group'>
        <div class='input-group-prepend'>
            <span class='input-group-text'>@</span>
        </div>
        <input id='email' class='form-control' name='email' placeholder='foo@bar.com'
            ng-model='email' type='email'
            ng-required="config.login_method == 'local'">
      </div>
    </div>
    <div class='form-group'>
      <label for='nick'>Handle/Nick</label>
      <input id='nick' class='form-control' name='nick' placeholder='Zero Cool'
        ng-model='nick' required>
    </div>
    <div class='form-group'
      ng-show="config.login_method == 'local'">
      <label for='password'>Password</label>
      <input id='password' class='form-control' name='password'
        placeholder='password' type='password' ng-model='password'
        ng-required="config.login_method == 'local'"
        ng-show="config.login_method == 'local'">
    </div>
    <div class='form-group'
      ng-show="config.login_method == 'local'">
      <label for='password2'>Repeat Password</label>
      <input id='password2' class='form-control' name='password2'
        placeholder='repeat password' type='password' ng-model='password2'
        ng-required="config.login_method == 'local'"
        ng-show="config.login_method == 'local'">
    </div>
    <div class='ng-hide' ng-show='config.teams'>
    <!-- Teams only! -->
      <div class='form-group'>
        <label for='team'>Team</label>
        <select id='team' class='form-control' name='team' ng-model='team'
            ng-required='config.teams'>
          <optgroup label='New Team'>
            <option value='new'>New</option>
          </optgroup>
          <optgroup label='Join Team'>
            <option ng-repeat='team in teams | orderBy:"name"'
              value='{{team.tid}}'>{{team.name}}</option>
          </optgroup>
        </select>
      </div>
      <div class='form-group' id='div-team-code' ng-hide='team == "new"'>
        <label for='team-code'>Team Code<br>(This is located on the
          "Profile" page of any existing team member.)</label>
        <input id='team-code' name='team_code' class='form-control'
          placeholder='10ab03cf' ng-model='team_code'
          ng-required='config.teams && (team != "new")'>
      </div>
      <div class='form-group' id='div-team-new' ng-show='team == "new"'>
        <label for='team-name'>Team Name</label>
        <input id='team-name' name='team_name' class='form-control'
          placeholder='Hackers' ng-model='team_name'
          ng-required='config.teams && (team == "new")'>
      </div>
    </div>
    <!-- /Teams only -->
    <!-- Invite only -->
    <div class='form-group ng-hide' ng-show='config.invite_only'>
      <label for='invite_key'>Invite Key</label>
      <input id='invite_key' name='invite_key' class='form-control'
        ng-model='invite_key', placeholder='Invite Key'
        ng-required='config.invite_only'
        ng-show='config.invite_only'>
    </div>
    <!-- /Invite only -->
    <input type='submit' value='Register' class='btn btn-primary'
      ng-disabled='registerForm.$invalid'>
  </form>
</div>
